<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>国省自检--${fns:getConfig('productName')}</title>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<script type="text/javascript">
function btnClick(){
	var url = '${ctx}/digital/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
	var data = {};
	if($('#btnSearch').length>0){ //有搜索按钮的情况下 获取条件进行搜索
		//将条件提取出来 
		//将条件存入data中
		//ajax请求   得到数据
		data['retrieval'] = getJson('condition');
		loadData(url,data);
	} else {
		loadData(url,data);
	}
}
//ajax执行成功之后的回调方法
function loadDataToTable(data){
	var attment = data['att'];
	var develop = data['infoManagement'];
	if($('#checkRecord').length>0){
		$('#checkRecord tbody').empty();
		for (var j = 0; j < develop.length; j++) {
			var tr = "<tr><td>"+parseInt(j+1)+"</td><td>"+develop[j].systemName+"</td><td>"+develop[j].systemDate+"</td>";
			if (develop[j].isShare == 1){
				tr += "<td>有</td>";
			} else {
				tr += "<td>无</td>";
			}
				tr += "<td>"+develop[j].haveSystem+"</td></tr>";
			$('#checkRecord tbody').append(tr);
			
		}
	}
	
	loadAttachment(attment);
	
	if(data['percent'] != undefined){
		//每次搜索前清空表格
		$('#checkResult').empty();
		var result = "";
		
		var content = '<table style="width:98%;text-align:center;margin-top:5px;" border="1"><thead><tr>'+
		  			  '<th>省检平台名称</th><th>建立时间</th><th>数据共享机制(有无)</th><th>包含的业务系统</th><th>检查得分</th>'+
		  			  '<th>总得分</th><th>完善度</th></tr>'+
		  			  '</thead><tbody></tbody></table>';			  
		$('#checkResult').append(content);
		for(var j = 0; j< develop.length; j++){
				result += '<tr><td>'+develop[j].systemName+'</td><td>'+develop[j].systemDate+'</td>';
				if (develop[j].isShare == 1){
					result += '<td>有</td>';
				}else {
					result += '<td>无</td>';
				}
				result += '<td>'+develop[j].haveSystem+'</td><td>'+develop[j].remark+'</td><td class="sumTd">'+data['sum']+'</td>'+
						  '<td class="perTd">'+data['percent']+'%</td></tr>';
		}
		$('#checkResult tbody').append(result);
	}
}

</script>
</head>
<body>
	<div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/digital/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
	<form id="checkForm" class="form-horizontal"  method="POST"  name="checkForm" action="${ctx}/digital/save.do?left=${fns:encodeParam(left)}&parentId=${fns:encodeParam(parentId)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}&leftChild=${fns:encodeParam(leftChild)}">
		<input type="hidden" name="token" value="${token}">
		<div id="show">
			<div id="showTable" class="showTable">
				<jsp:include page="/WEB-INF/views/check/common.jsp"/> 
				<div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="margin-right:10px;">
								<span>检查文件:</span>
								<select name="systemNameId" id="systemNameId">
									<option value="">请选择</option>
									<c:forEach items="${fns:getDigitalGroupBySystemName(projectId)}" var="infoManagement"  varStatus="idxStatus">
										<option value="${infoManagement.id}">${infoManagement.systemName}</option>
									</c:forEach>
								</select>
							</div>
							<div style="margin-right:10px;margin-top:5px;">
								<span>建立省级综合平台，进行系统整合得分<font style="color:red;">*</font>：</span>
								<input type='text' name = "yearFull" id="yearFull" value="3" class="required conInput"/>
							</div>
							<div style="float:left;margin-right:10px;margin-top:5px;">
								<span>建立路面养护管理系统、桥（隧）养护管理系统、路政管理系统、治超管理系统等业务管理系统，且正常应用得分<font style="color:red;">*</font>：</span>
								<input type='text' name = "yearPart" id="yearPart" value="1" class="required conInput"/>
							</div>
							<div id="x_s" style="float:right">
								<div class="x_ico"></div>
								<a href="#javascript:void(0)" onclick= "btnClick();"  id= "btnSearch" role="button" >搜索&nbsp;</a>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>四、检索结果</legend>
						<div class="content-title">
							<div class="tabbox">
								<div class="tab">
									<a href="javascript:;" class="on">系统检查情况</a>
									<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
										<a href="javascript:;">${menu.name}</a>
									</c:forEach>
							    </div>
							    <div class="content">
							    	<ul>
							    		<li>
							    			<table style="width:99.8%;text-align:center;margin-top:5px;" border="1" id="checkRecord">
									    		<thead>
									    			<th>序号</th>
									    			<th>系统名称</th>
										    		<th>建立时间</th>
										    		<th>数据共享机制（有/无）</th>
										    		<th>包含的业务系统</th>
										    		</thead>
								    				<tbody>
									    						
									    			</tbody>
							    			</table>
							    		</li>
							    		<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
							    			<c:if test="${idxStatus.index >= 0}">
							    				<li>
							    					<table style="width:99.8%;text-align:center;margin-top:5px;" border="1" id="${menu.tag}">
									    				<thead>
									    					<th>序号</th>
										    				<th>操作</th>
										    				<th>发文单位</th>
										    				<th>上传用户</th>
										    				<th>文件名</th>
										    				<th>发文日期</th>
										    				<th>上传日期</th>
										    				<th>文件大小</th>
										    				<th>文件类型</th>
										    			</thead>
								    					<tbody>
									    						
									    				</tbody>
							    					</table>
							    				</li>
							        		</c:if>
							    		</c:forEach>
							        </ul>
							    </div>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>五、检查评分</legend>
						<div class="content-title" id="checkResult">
						
						</div>
					</div>
				</div>
				<div class="model">
					<div class="content-btn">
						<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
						&nbsp;&nbsp;&nbsp;&nbsp;
						<input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
					</div>
				</div>
			</div>
		</div>
	</form>
	<script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>